
function gcd(a, b)
{
	if(b == 0)
		return a;

	return gcd(b, a%b);
}

function lcm(a, b)
{
	if(a < 1 || b < 1)
		return 0;

	if(a < b) {
	
		a = a + b;
		b = a - b;
		a = a - b;
	}

	return (a*b / gcd(a, b));
}

var a = 5;
var b = 7;

console.log(lcm(a, b));
